package gao.com.http;

import android.test.InstrumentationTestCase;
import android.util.Log;

/**
 * Created by admin on 2015/12/25.
 */
public class HttpTest extends InstrumentationTestCase{

    public void testHttpGet() throws Throwable{
        String url = "www.baidu.com";
        Request mRequest = new Request(url);
        String result =HttpUrlConnectionUtil.execute(mRequest);
        Log.i("" ,"get result:"+ result);
    }

    public void testHttpPost() throws Throwable{
        String url = "www.baidu.com";
        String content = "";
        Request mRequest = new Request(url , Request.RequestMethod.POST);
        mRequest.content = content;
        String result =HttpUrlConnectionUtil.execute(mRequest);
        Log.i("" ,"get result:"+ result);
    }
}
